package com.huike.mapper.dictionaries;

import com.github.pagehelper.Page;
import com.huike.dto.DictDatePageDTO;
import com.huike.dto.DictTypeDTO;
import com.huike.dto.DictionariesPageDTO;
import com.huike.vo.DictDateVO;
import com.huike.vo.DictPageVO;
import com.huike.vo.DictionariesVO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DictionariesMapper {
    Page<DictionariesVO> selectList(DictionariesPageDTO dto);

    @Select("select * from sys_dict_type where dict_id=#{id}")
    DictionariesVO selectById(Long id);

    @Select("select * from sys_dict_data where dict_type=#{status}")
    List<DictDateVO>  selectByStatus(String status);

    Page<DictDateVO> selectDateList(DictDatePageDTO dto);
    @Insert("insert into sys_dict_type(dict_name,dict_type,remark,status,create_time,update_time)values (#{dictName},#{dictType},#{remark},#{status},#{createTime},#{updateTime})")
    void dictTypeSave(DictPageVO vo);

    void dictTypeDelect(List<Long>ids);

    void dictTypeUpdate(DictTypeDTO dto);
    @Insert("insert into sys_dict_data(dict_label,dict_sort,dict_type,dict_value,remark,status,create_time,update_time)values (#{dictLabel},#{dictSort},#{dictType},#{dictValue},#{remark},#{status},#{createTime},#{updateTime})")
    void dictDateSave(DictDateVO vo);
    @Select("select * from sys_dict_data where dict_code=#{id}")
    DictDateVO dictDateSelectById(Long id);

    void dictDateUpdate(DictDateVO dto);

    void dictDateDelect(List<Long> ids);
}
